﻿//
// Created by francklinson on 2021/3/23.
//

#ifndef CPPPRIMERPLUSREADINGCODES_STRINGBAD_H
#define CPPPRIMERPLUSREADINGCODES_STRINGBAD_H

#include <iostream>

class StringBad
{
private:
    char *str;                // pointer to string
    int len;                   // length of string
    static int num_strings;    // number of objects
public:
    explicit StringBad(const char *s); // constructor
    StringBad();               // default constructor
    ~StringBad();              // destructor
    StringBad(const StringBad &st); // 复制构造
    StringBad &operator=(const StringBad &st);// 赋值构造

// friend function
    friend std::ostream &operator<<(std::ostream &os, const StringBad &st);

};

#endif //CPPPRIMERPLUSREADINGCODES_STRINGBAD_H
